﻿<!--#include file="const.inc"-->

<%
	dim remark,user,uid,name


	remark=qingtian.repsql(Request.form("remark"))
	name=qingtian.repsql(Request.form("name"))



select case v
case "0"
we0="<br/>"
hr="------------<br/>"
%>
<card title="发表留言"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
%>
<title>发表留言</title>
</head>
<body>
<%

End Select
	if sid="Null" then
		user="游客"
		uid=0
	else
		uid=qingtian.nid
		user=Replace(qingtian.name(uid),"'", "''")
	end if
Response.Write(""&dao&"<b><a href=""/index.asp?sid="&sidd&""">首页</a>&gt;<a href=""index.asp?sid="&sidd&""">留言首页</a>&gt;留言</b>"&we0&""&hr&"")
Response.Write(""&we&"")
		if remark="" or name="" then

			%>留言标题或内容不能为空!<br/><a href="add.asp?sid=<%=sidd%>">返回继续发表</a><%
		elseif session("remark")=remark then

			%>请不要重复发表留言!<br/><a href="add.asp?sid=<%=sidd%>">返回继续发表</a><%
		else
		if session("addtime")<>"" then
		if DATEDIFF("s", session("addtime"), now()) >60 then
		session("addtime")=now
		session("addcount")=1
		else
		session("addtime")=now
		session("addcount")=session("addcount")+1
		end if
		else
		session("addtime")=now
		session("addcount")=1
		end if
                if session("addcount")>1 then
			%>发表留言失败!请在60秒后再发表!

<%else%>发表留言成功!<br/><a href="index.asp?sid=<%=sidd%>">查看发表的留言</a>
<%
			session("remark")=remark
		conn.execute("insert into qingtian_ly ([name],[title],[user],[nid])  values ('"&name&"','"&remark&"','"&user&"',"&uid&")")
				set rs8=Server.CreateObject("Adodb.Recordset")
  				sql8="select top 1 id FROM [qingtian_user] where [bbs]=true order by id asc"
  				rs8.open sql8,conn,1,1
                                if not (rs8.bof and rs8.eof)  then
                                qingtian.addnfo(rs8("id")&"tt"&"站长你好!有人在你的网站里留言了快去看看吧![br][url=/liuy/?sid=[sid]]进入查看最新留言[/url]")
                               end if
                                rs8.close
                                set rs8=nothing
end if
		end if

    		     		%>
<%=we0%><%=qingtian.qingsav("560")%><%=hr%>
<%=sou%><a href='index.asp?sid=<%=sidd%>'>返回留言首页</a><%=we0%>
 
		<%

end Function
%>
